'use strict';

var mongoose = require('mongoose');
var Schema = mongoose.Schema;

var articleSchema = new Schema({
  title: String,
  type: Number,
  content: String,
  fId: String,
  createdAt: {type: Date, default: new Date()},
  updatedAt: {type: Date, default: new Date()}
});


var columnSchema = new Schema({
  name: String,
  createdAt: {type: Date, default: new Date()},
  updatedAt: {type: Date, default: new Date()}
});

mongoose.connect('mongodb://127.0.0.1/Odin');

module.exports.article = mongoose.model('articles',articleSchema);
module.exports.column = mongoose.model('columns', columnSchema);